import {Pipe, PipeTransform} from '@angular/core';

@Pipe({
  name: 'statusPipe'
})
export class StatusPipe implements PipeTransform {
  constructor() {
  }

  transform(value: any, values: any[], status: any[]): any {
    if (values.length !== status.length) {
      throw new Error(`values.length != colors.length`);
    }

    let result;
    for (let i = 0; i < values.length; i++) {
      if (value === values[i]) {
        result = status[i];
      }
    }
    return result;
  }
}
